<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@page import="com.lmpop.trade.ti_redeemrules.*"%>
<%@page import="java.util.*"%>
<%@ page import="com.lmpop.frame.util.PageTools"%>
<%
	request.setCharacterEncoding("UTF-8");
	Map ti_news = new Hashtable();

	Ti_redeemrulesInfo ti_ruleInfo = new Ti_redeemrulesInfo();
	String iStart = "0";
	int limit = 20;
	int counter = ti_ruleInfo.getCount();
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = ti_ruleInfo.getList(Integer.parseInt(iStart), limit);
	String pageString = new PageTools().getGoogleToolsBar(counter,
			"index.jsp?iStart=", Integer.parseInt(iStart), limit);
	Map rule = null;
%>
<html>
	<head>
		<title>兑换设置</title>
		<link href="/program/admin/index/css/style.css" rel="stylesheet"
			type="text/css">
		<script type="text/javascript" src="/js/commen.js"></script>
		<script type="text/javascript" src="redeemrules.js"></script>
	</head>

	<body>

		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td width="90%">
					<h1>
						兑换设置
					</h1>
				</td>
				<td>
					<a href="addInfo.jsp"><img
							src="/program/admin/index/images/post.gif" /> </a>
				</td>
			</tr>
		</table>

		<form action="index.jsp" name="indexForm" method="post">
			<%
				if (list != null && list.size() > 0) {
					int listsize = list.size();
			%>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="tablehe">
				<tr>
					<td><%=pageString%></td>
				</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="dl_bg">
				<tr>
					<td width="90%">
						<input type="button" name="delInfo" onclick="delIndexInfo()"
							value="删除" class="buttab" />
					</td>
					<td>
						总计:<%=counter%>条
					</td>
				</tr>
			</table>
			<table width="100%" cellpadding="1" cellspacing="1" class="listtab"
				border="0">
				<tr>
					<th width="5%" align="center">
						<input type="checkbox" name="checkall" id="checkall"
							onclick="selectAll()">
					</th>
					<th>
						财产类型
					</th>
					<th>
						目标类型
					</th>
					<th>
						财产数量
					</th>
					<th>
						目标数量
					</th>
					<th width="10%">
						修改
					</th>
					<th width="10%">
						删除
					</th>
				</tr>
				<%
					for (int i = 0; i < list.size(); i++) {
							String rule_id = "", property_type = "", target_type = "", property_money = "", target_money = "";
							rule = (Hashtable) list.get(i);
							if (rule.get("rule_id") != null)
								rule_id = rule.get("rule_id").toString();
							if (rule.get("property_type") != null)
								property_type = rule.get("property_type").toString();
							if (rule.get("target_type") != null)
								target_type = rule.get("target_type").toString();
							if (rule.get("property_money") != null)
								property_money = rule.get("property_money").toString();
							if (rule.get("target_money") != null)
								target_money = rule.get("target_money").toString();
				%>
				<tr>
					<td width="5%" align="center">
						<input type="checkbox" name="checkone<%=i%>" id="checkone<%=i%>"
							value="<%=rule_id%>" />
					</td>
					<td width="25%">
						<%
							if (property_type.equals("1")) {
						%>人民币<%
							} else if (property_type.equals("2")) {
						%>虚拟币<%
							} else if (property_type.equals("3")) {
						%>积分<%
							}
						%>
					</td>
					<td width="15%">
						<%
							if (target_type.equals("1")) {
						%>人民币<%
							} else if (target_type.equals("2")) {
						%>虚拟币<%
							} else if (target_type.equals("3")) {
						%>积分<%
							}
						%>
					</td>
					<td width="25%"><%=property_money%></td>
					<td width="15%"><%=target_money%></td>
					<td width="10%">
						<a href="updateInfo.jsp?rule_id=<%=rule_id%>"> <img
								src="/program/admin/images/edit.gif" title="修改" />
						</a>
					</td>
					<td width="10%">
						<a href="javascript:deleteOneInfo('<%=rule_id%>','5784');"><img
								src="/program/admin/images/delete.gif" title="删除" />
						</a></a>
					</td>
				</tr>
				<%
					}
				%>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="dl_bg">
				<tr>
					<td width="90%">
						<input type="button" name="delInfo" onclick="delIndexInfo()"
							value="删除" class="buttab" />
					</td>
					<td>
						总计:<%=counter%>条
					</td>
				</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="tablehe">
				<tr>
					<td><%=pageString%></td>
				</tr>
			</table>
			<input type="hidden" name="listsize" id="listsize"
				value="<%=listsize%>" />
			<input type="hidden" name="pkid" id="pkid" value="" />
			<input type="hidden" name="bpm_id" id="bpm_id" value="5784" />
		</form>
		<%
			} else {
		%>
		
		<font color='red' style='size: 10x'>目前您还没设置积分规则</font>
		<%
			}
		%>

	</body>

</html>
